/*
 * grunt-init
 * https://gruntjs.com/
 *
 * Copyright (c) 2014 "Cowboy" Ben Alman, contributors
 * Licensed under the MIT license.
 */
'use strict';
module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    watch: {
      client: {
        files: ['*.js', '**/*.asp', 'css/*.css', 'assets/js/*.js', 'assets/css/*.css'],
        options: {
          livereload: true
        }
      },
      scss: {
        files: ['assets/stylesheets/*.scss'],
        tasks: ['compass:dist', 'concat:sunsoft_css'],
        options: {
          livereload: true
        }
      },
      js: {
        files: ['assets/javascripts/*.js'],
        tasks: ['concat:sunsoft'],
        options: {
          livereload: true
        }
      },
      css: {
        files: ['assets/stylesheets/*.css'],
        tasks: ['concat:sunsoft_css'],
        options: {
          livereload: true
        }
      }
    },
    concat: {
      sunsoft: {
        src: ['assets/javascripts/*.js'],
        dest: 'assets/js/pageshare.js'
      },
      sunsoft_css: {
        src: ['assets/stylesheets/*.css'],
        dest: 'assets/css/pageshare.css'
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.file %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        src: 'js/<%=pkg.file %>.js',
        dest: 'dest/<%= pkg.file %>.min.js'
      }
    },
    compass: {
      dist: {
        options: {
          sassDir: 'assets/stylesheets',
          cssDir: 'assets/stylesheets',
          environment: 'development',
          outputStyle: 'compressed'
        }
      }
    }
  });
  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-compass');
  // By default, lint and run all tests.
  grunt.registerTask('default', ['watch', 'concat', 'uglify', 'compass']);
};